﻿Shader "Example01/04Shader"
{
    Properties
    {
        _MainColor("Color",Color)= (1,1,1,1)
    }
    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            struct a2v
            {
                float4 vertex :POSITION;
            };

            struct v2f
            {
                float4 pos :SV_POSITION;
            };
            
            // CG内部声明数据类型
            fixed4 _MainColor ;

            v2f vert (a2v v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                return o ;
            }

            fixed4 frag (v2f i) :SV_Target
            {
                return _MainColor;
            }
            ENDCG
        }
    }
}